package com.kcht.np.vo.user;

import lombok.Data;
import lombok.ToString;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.*;
import java.time.LocalDate;

/**
 * 管理员创建用户时的内容
 * */
@ToString
@Data
public class UserCanCreateInfo {
    @NotNull(message = "用户名不能为空")
    @Size(min = 5, message = "用户名长度不能少于五位")
    private String username;
    @NotNull(message = "密码不能为空")
    @Size(min = 5, message = "密码长度不能少于五位")
    private String password;

    /**
     * 确认密码
     */
    @NotNull(message = "密码不能为空")
    @Size(min = 5, message = "确认密码长度不能少于五位")
    private String rePassword;
    /**
     * 邮箱
     *
     */
    @Pattern(regexp = "^[a-zA-Z0-9_\\-@.]*$",message = "邮箱命名不正确")
    private String email;
    /**
     * 昵称
     */
    @Size(min = 1, message = "昵称长度不能少于1位")
    private String nickname;

    /**
     * 性别
     *
     */
    @Max(value = 2,message = "只能为女[0],男[1],未知[2]")
    @Min(value=0,message = "只能为女[0],男[1],未知[2]")
    private Integer gender;
}
